const express = require('express');
const router = express.Router();
const adminMessageController = require('../controllers/adminMessageController');
const { authorizeAdmin } = require('../middleware/authMiddleware'); // Assuming you have this

router.use(authorizeAdmin);

router.get('/', adminMessageController.getMessages);
router.post('/', adminMessageController.createMessage);
router.get('/:id', adminMessageController.getMessageById);
router.put('/:id', adminMessageController.updateMessage);
router.delete('/:id', adminMessageController.deleteMessage);
router.post('/:id/publish', adminMessageController.publishMessage);

module.exports = router;
